#ifndef _IMPES_FORMULATION_H_
#define _IMPES_FORMULATION_H_

#include "solverEquation_methods.h"
#include "exportVTK.h"
#include "TMesh.h"

namespace PRS           // PRS: Petroleum Reservoir Simulator
{
	class SIMULATION_core{
	public:

		SIMULATION_core();
		~SIMULATION_core();

		/**
		 * Load data from files, initialize pointers and structures
		 */
		int initialize(int argc, char **argv);

		/**
		 * Initialize a pointer to call the solver defined by user for the elliptic term in IMPES method
		 */
		Elliptic_equation* init_EllipticSolverPointer(int );

		/**
		 * Initialize a pointer to call the solver defined by user for the hiperbolic term in IMPES method
		 */
		Hyperbolic_equation* init_HyperbolicSolverPointer(int );

		/**
		 * Time stepping solver: that's the heart of simulation. For each loop over time
		 * elliptic and hyperbolic equations are computed.
		 */
		int tsSolver();

		/**
		 * Free pointers memory, output files
		 */
		int finalize();

	private:

		// pointer to solver pressure and saturation fields
		Elliptic_equation* pElliptic_eq;
		Hyperbolic_equation* pHyperbolic_eq;
		// set/get pressure, saturation, velocity, flux, gradients
		PhysicPropData *pPPData;
		// set/get parameters: CFL, filenames, methods
		SimulatorParameters *pSimPar;
		// parallel stuff
		MeshData *pMData;
		// calculate oil production
		OilProductionManagement *pOilProduction;
		TMesh *pTMesh_data;
	};
}
#endif
